package com.yc.damai.damaiother.mapper;

import com.yc.damai.entity.DmProduct;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * Company 源辰信息
 *
 * @author navy
 * @date 2024/9/6
 * Email haijunzhou@hnit.edu.cn
 */
public interface ProductMapper {

    @Select("select * from dm_product where is_hot = 1 limit 0,10")
    List<Map<String,Object>> selectHots();

    @Select("select * from dm_product where cid = #{cid} limit #{pageIndex},12")
    List<DmProduct> selectPro(@Param("cid") int cid, @Param("pageIndex") int pageIndex);

    @Select("select count(*) from dm_product where cid = #{cid}")
    int selectCount(int cid);

}
